package com.testfileupload.uploadimg.design.intermediary.zhongjie;

import com.testfileupload.uploadimg.design.intermediary.normal.Purcchase;
import com.testfileupload.uploadimg.design.intermediary.normal.Stock;

import java.util.Random;

public class Sale extends AbstractColleague {
    public Sale(AbstractMediator abstractMediator) {
        super(abstractMediator);
    }

    public void sellIBMComputer(int num) {
        super.abstractMediator.execute("sale.sell", num);
    }

    //0没人买，100卖的好
    public int getSaleStatus() {
        Random random = new Random();
        int saleStatus = random.nextInt(100);
        System.out.println("电脑销售的情况为" + saleStatus);
        return saleStatus;

    }

    public void offSale() {
        super.abstractMediator.execute("sale.offsell");
    }
}
